var rp = require('request-promise');
var cheerio = require('cheerio'); 
 
var options = {
    uri: 'http://www.gufengmh.com/manhua/wanjiexianzong/',
    transform: function (body) {
        return cheerio.load(body);
    }
};
 
rp(options)
    .then(function ($) {
        // Process html like you would with jQuery...
        let title=$('.book-title h1').text()
        let $chapters=$('ul#chapter-list-1').find('a')
        console.log(title,$chapters.length)
        $chapters.each(function(i){
            console.log($(this).attr('href'),$(this).text().replace(/(^\s*)|(\s*$)/g, ""))
        })
    })
    .catch(function (err) {
        // Crawling failed or Cheerio choked...
        console.error(err)
    });